<?php
	$this->title('View Patient');
?>

<h2>Patient <?=$patient->PatID?></h2>

<h3>Basic Information</h3>
	<table>
		<tr>
			<td style="color:#BF7A30;">Date of Birth</td>
			<td style="color:#BF7A30;">Gender</td>
			<td style="color:#BF7A30;">In a Relationship</td>
			<td style="color:#BF7A30;">Employed</td>
			<td style="color:#BF7A30;">Ticks (Work)</td>
			<td style="color:#BF7A30;">Ticks (Hunt)</td>
			<td style="color:#BF7A30;">Ticks (Play)</td>
			<td style="color:#BF7A30;">Ticks (Garden)</td>
			<td style="color:#BF7A30;">Tickbite Caused Disease</td>
			<td style="color:#BF7A30;">Rash</td>
			<td style="color:#BF7A30;">Date Diagnosed</td>
			<td style="color:#00A8E6;">Edit</td>
		</tr>
		<tr>
			<td><?=$patient->DOB?></td>
			<td><?=$patient->Gender?></td>
			<td><?php if ($patient->RelationshipStatus == 1) echo 'Y'; else echo 'N';?></td>
			<td><?php if ($patient->OccupationStatus == 1) echo 'Y'; else echo 'N';?></td>
			<td><?php if ($patient->WorkHabitat == 1) echo 'Y'; else echo 'N';?></td>
			<td><?php if ($patient->HuntHabitat == 1) echo 'Y'; else echo 'N';?></td>
			<td><?php if ($patient->PlayHabitat == 1) echo 'Y'; else echo 'N';?></td>
			<td><?php if ($patient->GardenHabitat == 1) echo 'Y'; else echo 'N';?></td>
			<td><?php if ($patient->TickBite == 1) echo 'Y'; else echo 'N';?></td>
			<td><?php if ($patient->Rash == 1) echo 'Y'; else echo 'N';?></td>
			<td><?=$patient->DateDiagnosed?></td>
			<td><?=$this->html->link('Edit', array('Patients::edit', 'args' => $patient->id));?></td>
	    </tr>
	<table>

<h3>Icd Information</h3>
	<table>
		<tr>
			<td style="color:#BF7A30;">Code</td>
			<td style="color:#BF7A30;">Name</td>
			<td style="color:#BF7A30;">Date Given</td>
			<td style="color:#00A8E6;">Edit</td>
			<td style="color:red;">Delete</td>
		</tr>	
	<?php foreach ($icd_nine_entries as $icd_nine_entry) { ?>
		<tr>
			<td><?=$icd_nine_entry->icd_code->code?></td>
			<td><?=$icd_nine_entry->icd_code->name?></td>
			<td><?=$icd_nine_entry->date_given?></td>
			<td><?=$this->html->link('Edit', array('IcdNineEntries::edit', 'args' => array($icd_nine_entry->id, $patient->id)));?></td>
			<td><?=$this->html->link('Delete', array('IcdNineEntries::delete', 'args' => array($icd_nine_entry->id, $patient->id)));?></td>
	    </tr>
	<?php } ?>
	<table>

<h3>Diagnostic Test Information</h3>
	<table>
		<tr>
			<td style="color:#BF7A30;">Name</td>
			<td style="color:#BF7A30;">Result 1</td>
			<td style="color:#BF7A30;">Result 2</td>
			<td style="color:#BF7A30;">Date Taken</td>
			<td style="color:#00A8E6;">Edit</td>
		</tr>	
	<?php foreach ($diagnostic_tests as $diagnostic_test) { ?>
		<tr>
			<td><?=$diagnostic_test->medical_test->Name?></td>
			<td><?=$diagnostic_test->result1?></td>
			<td><?=$diagnostic_test->result2?></td>
			<td><?=$diagnostic_test->record_date?></td>
			<td><?=$this->html->link('Edit', array('MedicalTestAnswers::edit', 'args' => $diagnostic_test->id));?></td>
	    </tr>
	<?php } ?>
	<table>

<h3>Prescription Information</h3>
	<table>
		<tr>
			<td style="color:#BF7A30;">Name</td>
			<td style="color:#BF7A30;">Daily Dosage</td>
			<td style="color:#BF7A30;">Start Date</td>
			<td style="color:#BF7A30;">End Date</td>
			<td style="color:#00A8E6;">Edit</td>
		</tr>	
	<?php foreach ($prescriptions as $prescription) { ?>
		<tr>
			<td><?=$prescription->medication->Name?></td>
			<td><?=$prescription->dosage?></td>
			<td><?=$prescription->start_date?></td>
			<td><?=$prescription->end_date?></td>
			<td><?=$this->html->link('Edit', array('PrescriptionRecords::edit', 'args' => $prescription->id));?></td>
	    </tr>
	<?php } ?>
	<table>

<h3>Psychological Test Information</h3>
	<table>
		<tr>
			<td style="color:#BF7A30;">Anxiety</td>
			<td style="color:#BF7A30;">Depression</td>
			<td style="color:#BF7A30;">Cognition</td>
			<td style="color:#BF7A30;">Quality of Life</td>
			<td style="color:#BF7A30;">Date Taken</td>
			<td style="color:#00A8E6;">Edit</td>
		</tr>	
	<?php foreach ($psychological_tests as $psychological_test) { ?>
		<tr>
			<td><?=$psychological_test->qnumber1 . ' : ' . $psychological_test->description_qnumber1?></td>
			<td><?=$psychological_test->qnumber2 . ' : ' . $psychological_test->description_qnumber2?></td>
			<td><?=$psychological_test->qnumber3?></td>
			<td><?=$psychological_test->global?></td>
			<td><?=$psychological_test->record_date?></td>
			<td><?=$this->html->link('Edit', array('PsychologicalTestAnswers::edit', 'args' => $psychological_test->id));?></td>
	    </tr>
	<?php } ?>
	<table>

<h3>Physical Symptom Information</h3>
	<table>
		<tr>
			<td style="color:#BF7A30;">Arthiritis/Joint Pain/Stiffness</td>
			<td style="color:#BF7A30;">Fatigue</td>
			<td style="color:#BF7A30;">Flu-like Symptoms</td>
			<td style="color:#BF7A30;">Dizziness</td>
			<td style="color:#BF7A30;">Headaches</td>
			<td style="color:#BF7A30;">Heart Palpitations</td>
			<td style="color:#BF7A30;">Muscle Pain and/or Numbness or Tingling</td>
			<td style="color:#BF7A30;">Muscle Weakness</td>
			<td style="color:#BF7A30;">Bell's Palsy</td>
			<td style="color:#BF7A30;">Meningitis</td>
			<td style="color:#BF7A30;">Seizures</td>
			<td style="color:#BF7A30;">Sweats</td>
			<td style="color:#BF7A30;">Neck Creaking</td>
			<td style="color:#BF7A30;">Tinnitis</td>
			<td style="color:#BF7A30;">Sleep Disturbances</td>
			<td style="color:#BF7A30;">Weight</td>
			<td style="color:#BF7A30;">Global</td>
			<td style="color:#BF7A30;">Record Date</td>
			<td style="color:#00A8E6;">Edit</td>
		</tr>	
	<?php foreach ($physical_symptoms as $physical_symptom) { ?>
		<tr>
			<td><?=$physical_symptom->qnumber1?></td>
			<td><?=$physical_symptom->qnumber2?></td>
			<td><?=$physical_symptom->qnumber3?></td>
			<td><?=$physical_symptom->qnumber4?></td>
			<td><?=$physical_symptom->qnumber5?></td>
			<td><?=$physical_symptom->qnumber6?></td>
			<td><?=$physical_symptom->qnumber7?></td>
			<td><?=$physical_symptom->qnumber8?></td>
			<td><?=$physical_symptom->qnumber9?></td>
			<td><?=$physical_symptom->qnumber10?></td>
			<td><?=$physical_symptom->qnumber11?></td>
			<td><?=$physical_symptom->qnumber12?></td>
			<td><?=$physical_symptom->qnumber13?></td>
			<td><?=$physical_symptom->qnumber14?></td>
			<td><?=$physical_symptom->qnumber15?></td>
			<td><?=$physical_symptom->qnumber16?></td>
			<td><?=$physical_symptom->qnumber17?></td>
			<td><?=$physical_symptom->record_date?></td>
			<td><?=$this->html->link('Edit', array('PhysicalSymptomAnswers::edit', 'args' => $physical_symptom->id));?></td>
	    </tr>
	<?php } ?>
	<table>

<h3>Neuro-Psychological Symptom Information</h3>
	<table>
		<tr>
			<td style="color:#BF7A30;">Attention Impairment</td>
			<td style="color:#BF7A30;">Anxiety and/or Panic</td>
			<td style="color:#BF7A30;">'Brain Fog' and/or Confusion</td>
			<td style="color:#BF7A30;">Cognitive Impairment (including forgetfullness)</td>
			<td style="color:#BF7A30;">Depression</td>
			<td style="color:#BF7A30;">Loss of Verbal Fluency</td>
			<td style="color:#BF7A30;">Irritability and/or Anger</td>
			<td style="color:#BF7A30;">Memory Loss/Impairment</td>
			<td style="color:#BF7A30;">Global</td>
			<td style="color:#BF7A30; width:8%;">Record Date</td>
			<td style="color:#00A8E6;">Edit</td>
		</tr>	
	<?php foreach ($neuropsychological_symptoms as $neuropsychological_symptom) { ?>
		<tr>
			<td><?=$neuropsychological_symptom->qnumber1?></td>
			<td><?=$neuropsychological_symptom->qnumber2?></td>
			<td><?=$neuropsychological_symptom->qnumber3?></td>
			<td><?=$neuropsychological_symptom->qnumber4?></td>
			<td><?=$neuropsychological_symptom->qnumber5?></td>
			<td><?=$neuropsychological_symptom->qnumber6?></td>
			<td><?=$neuropsychological_symptom->qnumber7?></td>
			<td><?=$neuropsychological_symptom->qnumber8?></td>
			<td><?=$neuropsychological_symptom->qnumber9?></td>
			<td><?=$neuropsychological_symptom->record_date?></td>
			<td><?=$this->html->link('Edit', array('NeuropsychologicalSymptomAnswers::edit', 'args' => $neuropsychological_symptom->id));?></td>
	    </tr>
	<?php } ?>
	<table>		